package com.example.xianzhi.dao.impl;

import com.example.xianzhi.dao.AdSmallDao;
import com.example.xianzhi.entity.TbAdSmall;
import com.example.xianzhi.util.ORMUtil;

import java.util.List;

public class AdSmallDaoImpl implements AdSmallDao {
    @Override
    public List<TbAdSmall> selectSmall(int goods_id) {
        String sql="SELECT * FROM `tb_ad_small`\n" +
                "WHERE goods_id=?";
        return new ORMUtil().selectList(TbAdSmall.class,sql,goods_id);
    }

    @Override
    public int insertGoodsPic(String goods_pic_name, int goods_id) {

        String sql="INSERT INTO tb_ad_small(goods_pic_small,goods_id) VALUES(?,?)";
        int i = new ORMUtil().executeDML(sql, goods_pic_name, goods_id);
        return i;

    }
}
